﻿using AllServer.Core;
using AllServer.GrpcClient.Account;
using Newtonsoft.Json;
using SqlSugar;

namespace AllServer.Proxy.Application
{
    /// <summary>
    /// 系统服务接口
    /// </summary>
    public class SystemAppService : IDynamicApiController
    {
        private readonly ISystemService _systemService;
        private readonly IAccountGrpcClient _accountGrpcClient;
        public SystemAppService(ISystemService systemService, IAccountGrpcClient accountGrpcClient)
        {
            _systemService = systemService;
            _accountGrpcClient = accountGrpcClient;
        }

        /// <summary>
        /// 获取系统描述
        /// </summary>
        /// <returns></returns>
        public async Task<string> GetDescription(string userCode)
        {
            var result = await _accountGrpcClient.GetMember(userCode);
            return "Member:" + JsonConvert.SerializeObject(result);
        }
    }
}
